package com.lyb.mapper;

import com.lyb.Dto.CategoryDto;
import com.lyb.pojo.Category;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CategoryMapper {
    @Insert("insert into category (name,createTime,updateTime) values (#{category.name},#{category.createTime},#{category.updateTime})")
    Boolean add(@Param("category") CategoryDto category);
    @Delete("delete from category where id=#{id}")
    Boolean del(Long id);
    @Update("update category set name=#{category.name},updateTime=#{category.updateTime} where id=#{category.id}")
    Boolean update(@Param("category") Category category);
    @Select("select * from category")
    List<Category> queryPage();
}
